/*
 * copyright 2010
 */
package cc.nuboat.easyjsf.managedbean;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author nuboat
 */
@SessionScoped
@ManagedBean(name="applicationbean")
public class ApplicationManagedBean {

    private static final long serialVersionUID = 1274002434330L;

    private Long count;

    @PostConstruct
    public void construct() {
        System.out.println("@PostConstruct");
    }
    
    @PreDestroy
    public void destroy() {
        System.out.println("@PreDestroy");
    }

    public ApplicationManagedBean() {
        System.out.println("ApplicationManagedBean");
        count = new Long(0);
    }

    public Long getCount() {
        this.count = this.count.longValue() + 1;
        return this.count;
    }

    public void setCount(Long count) {
        this.count = count;
    }

}